package com.itbour.web.action.material;


import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

import org.apache.struts2.ServletActionContext;

import com.itbour.com.page.Page;
import com.itbour.common.base.BaseAction;
import com.itbour.common.util.AliSmsUtil;
import com.itbour.common.util.StringUtils;
import com.itbour.dto.com.CoopAppInfoDto;
import com.itbour.dto.com.FeedbackFromInfoDto;
import com.itbour.dto.com.FeedbackInfoDto;
import com.itbour.dto.com.ItbAreaInfoDto;
import com.itbour.dto.com.PartnerAreaInfoDto;
import com.itbour.dto.com.PartnerCustInfoDto;
import com.itbour.dto.com.PartnerIncomeInfoDto;
import com.itbour.dto.com.PartnerInfoDto;
import com.itbour.dto.com.TopicInfoDto;
import com.itbour.dto.com.TopicRInfoDto;
import com.itbour.dto.com.UserInfoDto;
import com.itbour.dto.tg.TypeInfoDto;
import com.itbour.service.material.ItbComService;
import com.opensymphony.xwork2.ActionContext;


/**
 * copyright Itbour team 2016
 * 
 * @author xc
 */

public class ItbComWebAction extends BaseAction {
	private boolean TEST = true;

	private static final long serialVersionUID = 1L;
	
	private ItbComService itbComService;
	
	HashMap<String, Object> mapResult = new HashMap<String, Object>();
	
	// [热门/专题用]
	private HashMap<String, Object> topicMapResult = new HashMap<String, Object>();//[分页]专题信息列表
	private List<TopicInfoDto> topicInfoList;// 专题信息列表
	private TopicInfoDto topicInfo;// 更新用
	private String stId;// 热门/专题id
	private String findTopicTitle;// 检索条件[专题名称]
	private String findTopicType;// 检索条件[专题类型]
	private String findTopicTypeL;// 检索条件[专题类型L]
	private String findTopicUse;// 检索条件[专题用途]
	
	//专题下的设计模板
	private HashMap<String, Object> result = new HashMap<String, Object>();//专题设计模板
	private HashMap<String, Object> sDesignRes = new HashMap<String, Object>();//适合的专题设计模板
	private String findTmplName;// 检索条件(模版名)
	private String findTmplId;// 检索条件(模版id)
	private String findItemId;// 检索条件(关联商品id)
	private String findVip;// 检索条件(vip)
	private List<TypeInfoDto> listType;
	private String findTmplType;	
	// [用户反馈用]
	private HashMap<String, Object> feedbackMapResult = new HashMap<String, Object>();//[分页]反馈信息列表
	private List<FeedbackInfoDto> feedbackInfoList;// 反馈信息列表
	private FeedbackInfoDto feedbackInfo;// 更新用
	private String fbId;// 用户反馈id
	private List<FeedbackFromInfoDto> fbFromComboList;// 反馈来源
	private String findFbFrom;// 检索条件[反馈来源]
	private String findFbState;// 检索条件[反馈状态]
	private String findFbMobile;// 检索条件[手机号]
	
	// [合作申请用]
	private HashMap<String, Object> coopAppMapResult = new HashMap<String, Object>();//[分页]合作申请信息列表
	private List<CoopAppInfoDto> coopAppInfoList;// 合作申请信息列表
	private CoopAppInfoDto coopAppInfo;// 更新用
	private String findAppType;// 检索条件[申请类别]
	private String findAppState;// 检索条件[申请状态]
	private String findAppMobile;// 检索条件[手机号]
	
	// [合伙人用]
	private HashMap<String, Object> partnerMapResult = new HashMap<String, Object>();//[分页]合伙人信息列表
	private List<PartnerInfoDto> partnerInfoList;// 合伙人信息列表
	private PartnerInfoDto partnerInfo;// 更新用
	private String findPartnerName;// 检索条件[名字]
	private String findPartnerMobile;// 检索条件[手机号]
	private String findPartnerLevel;// 检索条件[等级]
	private String findApplyProv;// 检索条件[申请省]
	private String findApplyCity;// 检索条件[申请市]
	private String findApplyDist;// 检索条件[申请区]
	private String findHasCustFlg;// 检索条件[是否有下线]
	
	// [合伙人管辖区域用]
	private HashMap<String, Object> partnerAreaMapResult = new HashMap<String, Object>();//[分页]合伙人管辖区域信息列表
	private List<PartnerAreaInfoDto> partnerAreaInfoList;// 合伙人管辖区域信息列表
	private PartnerAreaInfoDto partnerAreaInfo;// 更新用
	private String findPartnerId;// 检索条件[合伙人id]
	private List<ItbAreaInfoDto> areaComboList;
	
	// [合伙人收益用]
	private HashMap<String, Object> partnerIncomeMapResult = new HashMap<String, Object>();//[分页]合伙人收益信息列表
	private List<PartnerIncomeInfoDto> partnerIncomeInfoList;// 合伙人收益信息列表
	private PartnerIncomeInfoDto partnerIncomeInfo;// 更新用
	
	// [合伙人下线用户用]
	private HashMap<String, Object> partnerCustMapResult = new HashMap<String, Object>();//[分页]合伙人下线用户信息列表
	private List<PartnerCustInfoDto> partnerCustInfoList;// 合伙人下线用户信息列表
	private PartnerCustInfoDto partnerCustInfo;// 更新用
	
	// [通用参数]
	private String findPubFlg;// 检索条件[发布状态]
	private String ids;// 通用ids[逗号连接]
	private String order;// 显示顺序
	
	
	// 发验证码
	// 该接口移到itbWeb工程
	public String sendVerCode() throws Exception {	
		
		if(TEST) return ERROR;// 直接返回
		
		mapResult.clear();
		
		String verCode = null;
		String errMsg = "NG";
		try {
			HttpServletRequest request = ServletActionContext.getRequest();
			String mobile = request.getParameter("mobile");
			
			Long mobileNum = Long.parseLong(mobile);
			if(mobileNum != null && mobileNum>0L && mobile.length()>=5) {
				AliSmsUtil smsUtil = new AliSmsUtil();
				verCode = smsUtil.sendVerCode(mobile);
			} else {
				errMsg = "Invalid phone number";
			}
		} catch(NumberFormatException e) {
			verCode = null;
			errMsg = "Invalid phone number";
		} catch(RuntimeException e) {
			verCode = null;
			errMsg = e.getMessage();
		}
		
		if(verCode != null) {
			mapResult.put("success", 1);
			mapResult.put("msg", "OK");
			HashMap<String, Object> dataMap = new HashMap<String, Object>();
			dataMap.put("code", verCode);
			mapResult.put("data", dataMap);
		}else {
			mapResult.put("success", 0);
			mapResult.put("msg", errMsg);
		}
		
		return SUCCESS;
	}
	
	// 分页获取专题信息
	public String getTopicInfoPg() throws Exception {
		// 用户信息
		Map<String, Object> session = ActionContext.getContext().getSession();
    	UserInfoDto user = (UserInfoDto)session.get("user");
    	
		HttpServletRequest request = ServletActionContext.getRequest();
		String pageNumber = request.getParameter("page");
		String pageSize = request.getParameter("rows");
		
		Map<String, Object> param = new HashMap<String, Object>();
		if (StringUtils.isNotEmpty(findTopicTitle)) {
			param.put("title", "%"+findTopicTitle+"%");
		}
		if (StringUtils.isNotEmpty(findTopicType)) {
			param.put("type", findTopicType);
		}
		if (StringUtils.isNotEmpty(findTopicTypeL)) {
			param.put("typeL", findTopicTypeL);
		}
		if (StringUtils.isNotEmpty(findTopicUse)) {
			param.put("use", findTopicUse);
		}
		if (StringUtils.isNotBlank(findPubFlg)) {
			param.put("publish", findPubFlg);
		}
		Page page = itbComService.topicPgQuery(param,
				Integer.parseInt(pageNumber),
				Integer.parseInt(pageSize));
		HashMap<String, Object> resMap = new HashMap<String, Object>();
		resMap.put("total", page.getTotalCount());
		resMap.put("rows", page.getResult());
		topicMapResult = resMap;
		return SUCCESS;
	}
	
	/**
	 * 功能：列表分页获取专题下的设计列表
	 * 系统：其它管理/专题一览  ItbComDao/getSpecialDesignInfo
	 * 参数：type设计分类/stId专题ID
	 */
	public String getTopicDesignInfo() throws Exception {
		Map<String, Object> session = ActionContext.getContext().getSession();
		UserInfoDto user = (UserInfoDto)session.get("user");
		if(user!=null && user.getUser_id()!=null){
			HttpServletRequest request = ServletActionContext.getRequest();
			String pageNumber = request.getParameter("page");
			String pageSize = request.getParameter("rows");
			Integer stId = Integer.parseInt(request.getParameter("stId"));
			Integer type = Integer.parseInt(request.getParameter("type"));
			if(stId!=null && type!=null){
				Map<String, Object> param = new HashMap<String, Object>();
				param.put("st_id",stId);
				Page page = null;
				if(type==3){
				 page = itbComService.getSpecialPPtInfo(param,
						Integer.parseInt(pageNumber),
						Integer.parseInt(pageSize));
				}else{
				page = itbComService.getSpecialDesignInfo(param,
							Integer.parseInt(pageNumber),
							Integer.parseInt(pageSize));
				}
				HashMap<String, Object> resMap = new HashMap<String, Object>();
				resMap.put("total", page.getTotalCount());
				resMap.put("rows", page.getResult());
				result = resMap;
			}
		}
		return SUCCESS;
	}
	
	/**
	 * 功能：列表获取专题下适合的设计模板
	 * 系统：其它管理/专题一览  ItbComDao/getSuitDesign
	 * 参数：type设计分类/stId专题ID
	 */
	public String getSuitDesignInfo() throws Exception {
		Map<String, Object> session = ActionContext.getContext().getSession();
		UserInfoDto user = (UserInfoDto)session.get("user");
		if(user!=null && user.getUser_id()!=null){
			HttpServletRequest request = ServletActionContext.getRequest();
			String pageNumber = request.getParameter("page");
			String pageSize = request.getParameter("rows");
			Integer type = Integer.parseInt(request.getParameter("type"));
			Integer stId = Integer.parseInt(request.getParameter("stId"));
			if(type!=null && stId!=null){
				Map<String, Object> param = new HashMap<String, Object>();
				if (StringUtils.isNotBlank(findVip)) {
	    			param.put("vip", findVip);
	    		}
				if (StringUtils.isNotBlank(findItemId)) {
	    			param.put("item_id", findItemId);
	    		}
				if (StringUtils.isNotEmpty(findTmplName)) {
	    			param.put("design_name", "%"+findTmplName+"%");
	    		}
				if (StringUtils.isNotBlank(findTmplId)) {
	    			param.put("design_id", findTmplId);
	    		}
				if (StringUtils.isNotBlank(findTmplType)) {
					param.put("type_id", findTmplType);
				}
				param.put("type",type);
				param.put("st_id",stId);
				Page page=null;
				if(type==3){
					 page= itbComService.getSuitPPtInfo(param,
							Integer.parseInt(pageNumber),
							Integer.parseInt(pageSize));
				}else{
					page = itbComService.getSuitDesignInfo(param,
							Integer.parseInt(pageNumber),
							Integer.parseInt(pageSize));
				}
				HashMap<String, Object> resMap = new HashMap<String, Object>();
				resMap.put("total", page.getTotalCount());
				resMap.put("rows", page.getResult());
				sDesignRes = resMap;
			}
		}
		return SUCCESS;
	}
	//专题类型下的 适合的设计模板
	public String selectOneType() throws Exception {
		Map<String, Object> session = ActionContext.getContext().getSession();
		UserInfoDto user = (UserInfoDto)session.get("user");
		if(user!=null && user.getUser_id()!=null){
			HttpServletRequest request = ServletActionContext.getRequest();
			Integer type = Integer.parseInt(request.getParameter("type"));
			if(type!=null){
				Map<String, Object> param = new HashMap<String, Object>();
				param.put("type_id",type);
				listType=itbComService.selectOneType(param);
			}
		}
		return SUCCESS;
	}
	//添加设计模板到专题下
	public void addSuitDesign() throws Exception {
		Map<String, Object> session = ActionContext.getContext().getSession();
		UserInfoDto user = (UserInfoDto)session.get("user");
		if(user!=null && user.getUser_id()!=null){
			HttpServletRequest request = ServletActionContext.getRequest();
			Integer stId = Integer.parseInt(request.getParameter("stId"));
			String designId = request.getParameter("design_id");
			if(designId!=null && stId!=null){
				Map<String, Object> param = new HashMap<String, Object>();
				JSONArray jArray =JSONArray.fromObject(designId);
				JSONObject jb = null;
				boolean b =false;
				for (int i = 0; i < jArray.size(); i++) {
					jb = jArray.getJSONObject(i);
					param.put("type",jb.get("top_type"));
					param.put("st_id",stId);
					param.put("update_by",user.getUser_id());
					param.put("design_id",jb.get("design_id"));
					b=itbComService.addSuitDesign(param);
				}
				if(b){
					this.writeJSON("ok");
				}else{
					this.writeJSON("no");
				}
			} else {
				this.writeJSON("ng");
			}
		} else {
			this.writeJSON("ng");
		}
	}
	//移除设计模板
	public void delTopicDesign() throws Exception {
		Map<String, Object> session = ActionContext.getContext().getSession();
		UserInfoDto user = (UserInfoDto)session.get("user");
		if(user!=null && user.getUser_id()!=null){
			HttpServletRequest request = ServletActionContext.getRequest();
			Integer stId = Integer.parseInt(request.getParameter("stId"));
			String designId = request.getParameter("design_id");
			if(designId!=null && stId!=null){
				Map<String, Object> param = new HashMap<String, Object>();
				param.put("st_id",stId);
				param.put("ids",designId);
				param.put("update_by",user.getUser_id());
				boolean b=itbComService.delTopicDesign(param);
				if(b){
					this.writeJSON("ok");
				}else{
					this.writeJSON("no");
				}
			} else {
				this.writeJSON("ng");
			}
		} else {
			this.writeJSON("ng");
		}
	}
	
	//修改专题下设计模板order
	public void updTorder() throws Exception {
		Map<String, Object> session = ActionContext.getContext().getSession();
		UserInfoDto user = (UserInfoDto)session.get("user");
		if(user!=null && user.getUser_id()!=null){
			HttpServletRequest request = ServletActionContext.getRequest();
			Integer stId = Integer.parseInt(request.getParameter("stId"));
			Integer designId = Integer.parseInt(request.getParameter("designId"));
			Integer order = Integer.parseInt(request.getParameter("order"));
			if(designId!=null && stId!=null){
				Map<String, Object> param = new HashMap<String, Object>();
				param.put("st_id",stId);
				param.put("design_id",designId);
				param.put("order",order);
				param.put("update_by",user.getUser_id());
				boolean b=itbComService.udpTorder(param);
				if(b){
					this.writeJSON("ok");
				}else{
					this.writeJSON("no");
				}
			} else {
				this.writeJSON("ng");
			}
		} else {
			this.writeJSON("ng");
		}
	}
	
	
	// 获取专题信息列表
	public String getTopicInfoLst() throws Exception {
		HttpServletRequest request = ServletActionContext.getRequest();
		Map<String, Object> param = new HashMap<String, Object>();
		String id = request.getParameter("st_id");
		if (StringUtils.isNotEmpty(id)) {
			param.put("st_id", id);
		}
		topicInfoList = itbComService.selectTopicInfo(param);
		return SUCCESS;
	}
	
	// 删除专题信息
	public void delTopic() throws Exception {
		Map<String, Object> session = ActionContext.getContext().getSession();
    	UserInfoDto user = (UserInfoDto)session.get("user");
    	if(user!=null && user.getUser_id()>0) {
    		itbComService.delTopic(ids);
    		this.writeJSON("ok");
    	} else {
			this.writeJSON("ng");
		}
	}
	
	// 添加专题信息
	public void addTopic() throws Exception {
		if (topicInfo != null) {
			Map<String, Object> session = ActionContext.getContext().getSession();
	    	UserInfoDto user = (UserInfoDto)session.get("user");
	    	if (user != null) {
	    		topicInfo.setUpdate_by(user.getUser_id().toString());
	    	}
	    	
	    	if(topicInfo.getSt_id()!=null && topicInfo.getSt_id()>0){
	    		// 更新
	    		this.updTopic();
	    	} else {
	    		// 新建
	    		itbComService.addTopic(topicInfo);
	    		this.writeJSON("ok");
	    	}
		} else {
			this.writeJSON("ng");
		}
	}
	
	// 更新专题信息
	public void updTopic() throws Exception {
		if (topicInfo != null && topicInfo.getSt_id()!=null) {
			Map<String, Object> session = ActionContext.getContext().getSession();
	    	UserInfoDto user = (UserInfoDto)session.get("user");
	    	if(user!=null && user.getUser_id()>0) {
	    		Map<String, Object> param = new HashMap<String, Object>();
		    	param.put("st_id", topicInfo.getSt_id());
		    	param.put("update_by", user.getUser_id());
		    	
		    	if(topicInfo.getType() != null && topicInfo.getType()>0) {
		    		param.put("type", topicInfo.getType());
		    	}
		    	if(topicInfo.getUse() != null && topicInfo.getUse()>0) {
		    		param.put("use", topicInfo.getUse());
		    	}
		    	if(topicInfo.getTitle() != null) {
		    		param.put("title", topicInfo.getTitle());
		    	}
		    	if(topicInfo.getDesc() != null) {
		    		param.put("desc", topicInfo.getDesc());
		    	}
		    	if(topicInfo.getThumb() != null) {
		    		param.put("thumb", topicInfo.getThumb());
		    	}
		    	itbComService.updTopic(param);
				this.writeJSON("ok");
	    	} else {
				this.writeJSON("ng");
			}
		} else {
			this.writeJSON("ng");
		}
	}
	
	// 取消发布专题
	public void cancelTopicPublish() throws Exception {
		if (StringUtils.isNotBlank(ids)) {
			Map<String, Object> session = ActionContext.getContext().getSession();
	    	UserInfoDto user = (UserInfoDto)session.get("user");
	    	if(user!=null && user.getUser_id()!=null){
				Map<String, Object> param = new HashMap<String, Object>();
				param.put("publish", 0);
				param.put("ids", StringUtils.listToString2(StringUtils.stringToList2(ids)));
				param.put("update_by", user.getUser_id());
				itbComService.updTopic(param);
				this.writeJSON("ok");
	    	} else {
				this.writeJSON("ng");
			}
		} else {
			this.writeJSON("ng");
		}
	}
	// 发布专题
	public void doTopicPublish() throws Exception {
		// ids: ","连接
		if (StringUtils.isNotBlank(ids)) {
			Map<String, Object> session = ActionContext.getContext().getSession();
	    	UserInfoDto user = (UserInfoDto)session.get("user");
	    	if(user!=null && user.getUser_id()!=null){
	    		List<Long> listId = StringUtils.stringToList2(ids);

	    		Map<String, Object> param = new HashMap<String, Object>();
				param.put("publish", 1);
				param.put("ids", StringUtils.listToString2(listId));
				param.put("update_by", user.getUser_id());
				itbComService.updTopic(param);
				this.writeJSON("ok");
	    	} else {
				this.writeJSON("ng");
			}
		} else {
			this.writeJSON("ng");
		}
	}
	
	// 修改专题显示顺序
	public void updTopicOrder() throws Exception {
		if (StringUtils.isNotBlank(stId)) {
			Map<String, Object> session = ActionContext.getContext().getSession();
	    	UserInfoDto user = (UserInfoDto)session.get("user");
	    	// update
	    	if(user!=null && user.getUser_id()!=null){
		    	Map<String, Object> param = new HashMap<String, Object>();
				param.put("order", Integer.valueOf(order));
				param.put("st_id", Long.valueOf(stId));
				param.put("update_by", user.getUser_id());
				itbComService.updTopic(param);
				this.writeJSON("ok");
	    	} else {
				this.writeJSON("ng");
			}
		} else {
			this.writeJSON("ng");
		}
	}
	
	/**
	 * 功能：分页获取用户反馈信息
	 * 参数：反馈来源/findFbFrom
	 * 参数：手机号/findFbMobile
	 * 参数：反馈状态/findFbState
	 * 参数：反馈类型/findFebType
	 */
	private String findFebType;
	public String getFeedbackInfoPg() throws Exception {
		// 用户信息
		Map<String, Object> session = ActionContext.getContext().getSession();
    	UserInfoDto user = (UserInfoDto)session.get("user");
    	
		HttpServletRequest request = ServletActionContext.getRequest();
		String pageNumber = request.getParameter("page");
		String pageSize = request.getParameter("rows");
		
		Map<String, Object> param = new HashMap<String, Object>();
		if (StringUtils.isNotBlank(findFbFrom)) {
			param.put("from", findFbFrom);
		}
		if (StringUtils.isNotEmpty(findFbMobile)) {
			param.put("mobile", "%"+findFbMobile+"%");
		}
		if (StringUtils.isNotBlank(findFbState)) {
			param.put("state", findFbState);
		}
		if (StringUtils.isNotBlank(findFebType)){
			param.put("type", findFebType);
		}
		Page page = itbComService.feedbackPgQuery(param,
				Integer.parseInt(pageNumber),
				Integer.parseInt(pageSize));
		HashMap<String, Object> resMap = new HashMap<String, Object>();
		resMap.put("total", page.getTotalCount());
		resMap.put("rows", page.getResult());
		feedbackMapResult = resMap;
		return SUCCESS;
	}
	public String getFindFebType() {
		return findFebType;
	}
	public void setFindFebType(String findFebType) {
		this.findFebType = findFebType;
	}
	
	

	// 获取用户反馈信息列表
	public String getFeedbackInfoLst() throws Exception {
		HttpServletRequest request = ServletActionContext.getRequest();
		Map<String, Object> param = new HashMap<String, Object>();
		String id = request.getParameter("fb_id");
		if (StringUtils.isNotEmpty(id)) {
			param.put("id", id);
		}
		feedbackInfoList = itbComService.selectFeedbackInfo(param);
		return SUCCESS;
	}
	
	// 删除用户反馈
	public void delFeedback() throws Exception {
		itbComService.delFeedback(ids);
		this.writeJSON("ok");
	}
	
	// 更新用户反馈
	public void updFeedback() throws Exception {
		if (feedbackInfo != null && feedbackInfo.getId()!=null) {
			Map<String, Object> session = ActionContext.getContext().getSession();
	    	UserInfoDto user = (UserInfoDto)session.get("user");
	    	if(user != null && user.getUser_id()>0) {
	    		Map<String, Object> param = new HashMap<String, Object>();
		    	param.put("id", feedbackInfo.getId());
	    		param.put("update_by", user.getUser_id());
	    		if(feedbackInfo.getState() != null) {
		    		param.put("state", feedbackInfo.getState());
		    	}
		    	if(feedbackInfo.getNote() != null) {
		    		param.put("note", feedbackInfo.getNote());
		    	}
		    	
		    	itbComService.updFeedback(param);
				this.writeJSON("ok");
				
	    	} else {
				this.writeJSON("ng");
			}
		} else {
			this.writeJSON("ng");
		}
	}
	
	// 获取反馈来源
	public String getFbFrom4Combo() throws Exception {
		HttpServletRequest request = ServletActionContext.getRequest();
		String flg = request.getParameter("blkFlg");
		Map<String, Object> param = new HashMap<String, Object>();
		fbFromComboList = itbComService.getFeedbackFrom4Combo(param);
		if(fbFromComboList != null && fbFromComboList.size()>0){
			// 添加空白项目
			if("1".equals(flg)){
				FeedbackFromInfoDto blankItem = new FeedbackFromInfoDto();
				blankItem.setFrom_value("");
				blankItem.setFrom_text("[不限]");
				fbFromComboList.add(0, blankItem);
			}
		}
		return SUCCESS;
	}
	
	
	// 分页获取合作申请信息
	public String getCoopAppInfoPg() throws Exception {
		// 用户信息
		Map<String, Object> session = ActionContext.getContext().getSession();
    	UserInfoDto user = (UserInfoDto)session.get("user");
    	
		HttpServletRequest request = ServletActionContext.getRequest();
		String pageNumber = request.getParameter("page");
		String pageSize = request.getParameter("rows");
		
		Map<String, Object> param = new HashMap<String, Object>();
		if (StringUtils.isNotEmpty(findAppMobile)) {
			param.put("mobile", "%"+findAppMobile+"%");
		}
		if (StringUtils.isNotBlank(findAppType)) {
			param.put("type", findAppType);
		}
		if (StringUtils.isNotBlank(findAppState)) {
			param.put("state", findAppState);
		}
		Page page = itbComService.coopAppPgQuery(param,
				Integer.parseInt(pageNumber),
				Integer.parseInt(pageSize));
		HashMap<String, Object> resMap = new HashMap<String, Object>();
		resMap.put("total", page.getTotalCount());
		resMap.put("rows", page.getResult());
		//writeJSON(resMap);
		coopAppMapResult = resMap;
		return SUCCESS;
	}
	
	// 获取合作申请信息列表
	public String getCoopAppInfoLst() throws Exception {
		HttpServletRequest request = ServletActionContext.getRequest();
		Map<String, Object> param = new HashMap<String, Object>();
		String id = request.getParameter("id");
		if (StringUtils.isNotEmpty(id)) {
			param.put("id", id);
		}
		coopAppInfoList = itbComService.selectCoopAppInfo(param);
		return SUCCESS;
	}
	
	// 删除合作申请
	public void delCoopApp() throws Exception {
		Map<String, Object> session = ActionContext.getContext().getSession();
    	UserInfoDto user = (UserInfoDto)session.get("user");
    	if(user!=null && user.getUser_id()>0) {
    		itbComService.delCoopApp(ids);
    		this.writeJSON("ok");
    	} else {
    		this.writeJSON("ng");
    	}
	}
	
	// 更新合作申请
	public void updCoopApp() throws Exception {
		if (coopAppInfo != null && coopAppInfo.getId()!=null) {
			Map<String, Object> session = ActionContext.getContext().getSession();
	    	UserInfoDto user = (UserInfoDto)session.get("user");
	    	if(user != null && user.getUser_id()>0) {
	    		Map<String, Object> param = new HashMap<String, Object>();
		    	param.put("id", coopAppInfo.getId());
	    		param.put("update_by", user.getUser_id());
	    		
	    		if(coopAppInfo.getState() != null) {
		    		param.put("state", coopAppInfo.getState());
		    	}
	    		if(coopAppInfo.getDesc() != null) {
		    		param.put("desc", coopAppInfo.getDesc());
		    	}
		    	
		    	itbComService.updCoopApp(param);
		    	this.writeJSON("ok");
		    	
	    	} else {
	    		this.writeJSON("ng");
	    	}
		} else {
			this.writeJSON("ng");
		}
	}
	
	
	// 分页获取合伙人信息
	public String getPartnerInfoPg() throws Exception {
		// 用户信息
		Map<String, Object> session = ActionContext.getContext().getSession();
    	UserInfoDto user = (UserInfoDto)session.get("user");
    	
		HttpServletRequest request = ServletActionContext.getRequest();
		String pageNumber = request.getParameter("page");
		String pageSize = request.getParameter("rows");
		
		Map<String, Object> param = new HashMap<String, Object>();
		if (StringUtils.isNotEmpty(findPartnerMobile)) {
			param.put("mobile", "%"+findPartnerMobile+"%");
		}
		if (StringUtils.isNotEmpty(findPartnerName)) {
			param.put("name", "%"+findPartnerName+"%");
		}
		if (StringUtils.isNotBlank(findPartnerLevel)) {
			param.put("level", findPartnerLevel);
		}
		if (StringUtils.isNotBlank(findApplyProv)) {
			param.put("applyProv", findApplyProv);
		}
		if (StringUtils.isNotBlank(findApplyCity)) {
			param.put("applyCity", findApplyCity);
		}
		if (StringUtils.isNotBlank(findApplyDist)) {
			param.put("applyDist", findApplyDist);
		}
		if (StringUtils.isNotBlank(findHasCustFlg)) {
			param.put("hasCustFlg", findHasCustFlg);
		}
		
		Page page = itbComService.partnerPgQuery(param,
				Integer.parseInt(pageNumber),
				Integer.parseInt(pageSize));
		HashMap<String, Object> resMap = new HashMap<String, Object>();
		resMap.put("total", page.getTotalCount());
		resMap.put("rows", page.getResult());
		//writeJSON(resMap);
		partnerMapResult = resMap;
		return SUCCESS;
	}
	
	// 获取合伙人信息列表
	public String getPartnerInfoLst() throws Exception {
		HttpServletRequest request = ServletActionContext.getRequest();
		Map<String, Object> param = new HashMap<String, Object>();
		String id = request.getParameter("id");
		if (StringUtils.isNotEmpty(id)) {
			param.put("partner_id", id);
		}
		partnerInfoList = itbComService.selectPartnerInfo(param);
		return SUCCESS;
	}
	
	// 根据申请添加合伙人
	public void addPartnerByApply() throws Exception {
		Map<String, Object> session = ActionContext.getContext().getSession();
    	UserInfoDto user = (UserInfoDto)session.get("user");
    	if(user != null && user.getUser_id()>0) {
    		
    		HttpServletRequest request = ServletActionContext.getRequest();
    		String applyId = request.getParameter("apply_id");
    		if(StringUtils.isNotEmpty(applyId)) {
    			
    			// 检索申请信息
    			Map<String, Object> param = new HashMap<String, Object>();
    			param.put("id", applyId);
    			List<CoopAppInfoDto> applyList = itbComService.selectCoopAppInfo(param);
    			if(applyList!=null && applyList.size()>0) {
    				CoopAppInfoDto applyInfo = applyList.get(0);
    				if(applyInfo!=null && applyInfo.getUser_id()>0) {
    					
    					// 检查是否添加过
    					Map<String, Object> param2 = new HashMap<String, Object>();
    					param2.put("user_id", applyInfo.getUser_id());// 申请人用户id
    					List<PartnerInfoDto> ptnrLst = itbComService.selectPartnerInfo(param2);
    					if(ptnrLst!=null && ptnrLst.size()>0) {
    						this.writeJSON("ok");
    					} else {
    						// 新建合伙人
    						param2.put("apply_id", applyId);
    						param2.put("level", 10);// 默认普通
    						param2.put("name", applyInfo.getName());
    						param2.put("mobile", applyInfo.getMobile());
    						param2.put("bank", applyInfo.getBank());
    						param2.put("bank_account", applyInfo.getBank_account());
    						param2.put("desc", "");// TODO
    						param2.put("update_by", user.getUser_id());// 后台登录用户
    						itbComService.addPartner(param2);
    						
    						// 检查[新建合伙人]之前是否为其它人[下线]
    						itbComService.updPartnerCustEndTime(param2);
    						this.writeJSON("ok");
    					}
    				} else {
            			this.writeJSON("ng");
            		}
    			} else {
        			this.writeJSON("ng");
        		}
    		} else {
    			this.writeJSON("ng");
    		}
    	} else {
    		this.writeJSON("ng");
    	}
    	
	}
	
	// 删除合伙人
	public void delPartner() throws Exception {
		Map<String, Object> session = ActionContext.getContext().getSession();
    	UserInfoDto user = (UserInfoDto)session.get("user");
    	if(user != null && user.getUser_id()>0) {
    		itbComService.delPartner(ids);
        	this.writeJSON("ok");
    	} else {
    		this.writeJSON("ng");
    	}
	}
	
	// 更新合伙人
	public void updPartner() throws Exception {
		if (partnerInfo != null && partnerInfo.getPartner_id()!=null) {
			Map<String, Object> session = ActionContext.getContext().getSession();
	    	UserInfoDto user = (UserInfoDto)session.get("user");
	    	if(user != null && user.getUser_id()>0) {
	    		Map<String, Object> param = new HashMap<String, Object>();
		    	param.put("partner_id", partnerInfo.getPartner_id());
	    		param.put("update_by", user.getUser_id());
	    		
	    		if(partnerInfo.getName() != null) {
		    		param.put("name", partnerInfo.getName());
		    	}
		    	if(partnerInfo.getMobile() != null) {
		    		param.put("mobile", partnerInfo.getMobile());
		    	}
		    	if(partnerInfo.getLevel() != null) {
		    		param.put("level", partnerInfo.getLevel());
		    	}
		    	if(partnerInfo.getBank_account() != null) {
		    		param.put("bank_account", partnerInfo.getBank_account());
		    	}
		    	if(partnerInfo.getBank() != null) {
		    		param.put("bank", partnerInfo.getBank());
		    	}
		    	if(partnerInfo.getDesc() != null) {
		    		param.put("desc", partnerInfo.getDesc());
		    	}
		    	
		    	itbComService.updPartner(param);
				this.writeJSON("ok");
				
	    	} else {
	    		this.writeJSON("ng");
	    	}
		} else {
    		this.writeJSON("ng");
    	}
	}
	
	
	// 分页获取合伙人管辖区域信息
	public String getPartnerAreaInfoPg() throws Exception {
		// 用户信息
		Map<String, Object> session = ActionContext.getContext().getSession();
    	UserInfoDto user = (UserInfoDto)session.get("user");
    	
		HttpServletRequest request = ServletActionContext.getRequest();
		String pageNumber = request.getParameter("page");
		String pageSize = request.getParameter("rows");
		
		Map<String, Object> param = new HashMap<String, Object>();
		if (StringUtils.isNotBlank(findPartnerId)) {
			param.put("partner_id", findPartnerId);
		}
		Page page = itbComService.partnerAreaPgQuery(param,
				Integer.parseInt(pageNumber),
				Integer.parseInt(pageSize));
		HashMap<String, Object> resMap = new HashMap<String, Object>();
		resMap.put("total", page.getTotalCount());
		resMap.put("rows", page.getResult());
		//writeJSON(resMap);
		partnerAreaMapResult = resMap;
		return SUCCESS;
	}
	
	// 添加合伙人管辖区域
	public void addPartnerArea() throws Exception {
		if (partnerAreaInfo != null && partnerAreaInfo.getPartner_id()!=null) {
			Map<String, Object> session = ActionContext.getContext().getSession();
	    	UserInfoDto user = (UserInfoDto)session.get("user");
	    	if(user!=null && user.getUser_id()>0) {
	    		Map<String, Object> param = new HashMap<String, Object>();
		    	param.put("partner_id", partnerAreaInfo.getPartner_id());
		    	param.put("update_by", user.getUser_id());
		    	
		    	if(partnerAreaInfo.getProv() != null && partnerAreaInfo.getProv()>0) {
		    		param.put("prov", partnerAreaInfo.getProv());
		    	}
		    	if(partnerAreaInfo.getCity() != null && partnerAreaInfo.getCity()>0) {
		    		param.put("city", partnerAreaInfo.getCity());
		    	}
		    	if(partnerAreaInfo.getDist() != null && partnerAreaInfo.getDist()>0) {
		    		param.put("dist", partnerAreaInfo.getDist());
		    	}
		    	
		    	// 先check
		    	List<PartnerAreaInfoDto> chkLst = itbComService.selectPartnerAreaInfoForChk(param);
		    	if(chkLst!=null && chkLst.size()>0) {
		    		this.writeJSON("exist");
		    	} else {
		    		// 添加
		    		itbComService.addPartnerArea(param);
		    		this.writeJSON("ok");
		    	}
	    	} else {
	    		this.writeJSON("ng");
	    	}
		} else {
			this.writeJSON("ng");
		}
	}
	
	// 删除合伙人管辖区域
	public void delPartnerArea() throws Exception {
		Map<String, Object> session = ActionContext.getContext().getSession();
    	UserInfoDto user = (UserInfoDto)session.get("user");
    	if(user != null && user.getUser_id()>0) {
    		itbComService.delPartnerArea(ids);
        	this.writeJSON("ok");
    	} else {
        	this.writeJSON("ng");
    	}
	}
	
	// 获取区域列表
	public String getAreaForCombo() throws Exception {
		HttpServletRequest request = ServletActionContext.getRequest();
		String parent = request.getParameter("parent");
		String flg = request.getParameter("blkFlg");
		Map<String, Object> param = new HashMap<String, Object>();
		if(StringUtils.isNotBlank(parent)){
			param.put("parent", parent);
		}
		areaComboList = itbComService.getAreaForCombo(param);
		if(areaComboList != null && areaComboList.size()>0){
			// 添加空白项目
			if("1".equals(flg)){
				ItbAreaInfoDto blankItem = new ItbAreaInfoDto();
				blankItem.setId(0L);
				blankItem.setName("[不限]");
				areaComboList.add(0, blankItem);
			}
			
			// 默认选中第一个
			areaComboList.get(0).setSelected(true);
		}
		return SUCCESS;
	}
	
	
	// 分页获取合伙人收益信息
	public String getPartnerIncomeInfoPg() throws Exception {
		// 用户信息
		Map<String, Object> session = ActionContext.getContext().getSession();
    	UserInfoDto user = (UserInfoDto)session.get("user");
    	
		HttpServletRequest request = ServletActionContext.getRequest();
		String pageNumber = request.getParameter("page");
		String pageSize = request.getParameter("rows");
		
		Map<String, Object> param = new HashMap<String, Object>();
		if (StringUtils.isNotBlank(findPartnerId)) {
			param.put("partner_id", findPartnerId);
		}
		Page page = itbComService.partnerIncomePgQuery(param,
				Integer.parseInt(pageNumber),
				Integer.parseInt(pageSize));
		HashMap<String, Object> resMap = new HashMap<String, Object>();
		resMap.put("total", page.getTotalCount());
		resMap.put("rows", page.getResult());
		//writeJSON(resMap);
		partnerIncomeMapResult = resMap;
		return SUCCESS;
	}
	
	// 更新合伙人收益
	public void updPartnerIncome() throws Exception {
		if (partnerIncomeInfo != null && partnerIncomeInfo.getId()!=null) {
			Map<String, Object> session = ActionContext.getContext().getSession();
	    	UserInfoDto user = (UserInfoDto)session.get("user");
	    	if(user != null && user.getUser_id()>0) {
	    		Map<String, Object> param = new HashMap<String, Object>();
		    	param.put("id", partnerIncomeInfo.getId());
	    		param.put("update_by", user.getUser_id());
	    		
	    		if(partnerIncomeInfo.getDesc() != null) {
		    		param.put("desc", partnerIncomeInfo.getDesc());
		    	}
		    	if(partnerIncomeInfo.getIncome() != null) {
		    		param.put("income", partnerIncomeInfo.getIncome());
		    	}
		    	if(partnerIncomeInfo.getIncome_base() != null) {
		    		param.put("income_base", partnerIncomeInfo.getIncome_base());
		    	}
		    	if(partnerIncomeInfo.getIncome_extra() != null) {
		    		param.put("income_extra", partnerIncomeInfo.getIncome_extra());
		    	}
		    	if(partnerIncomeInfo.getIncome_bonus() != null) {
		    		param.put("income_bonus", partnerIncomeInfo.getIncome_bonus());
		    	}
		    	if(partnerIncomeInfo.getState() != null) {
		    		param.put("state", partnerIncomeInfo.getState());
		    	}
		    	
		    	itbComService.updPartnerIncome(param);
				this.writeJSON("ok");
				
	    	} else {
	        	this.writeJSON("ng");
	    	}
		} else {
        	this.writeJSON("ng");
    	}
	}
	
	// 添加合伙人收益
	public void addPartnerIncome() throws Exception {
		if (partnerIncomeInfo != null && partnerIncomeInfo.getPartner_id()!=null) {
			Map<String, Object> session = ActionContext.getContext().getSession();
	    	UserInfoDto user = (UserInfoDto)session.get("user");
	    	if(user!=null && user.getUser_id()>0) {
	    		Map<String, Object> param = new HashMap<String, Object>();
		    	param.put("partner_id", partnerIncomeInfo.getPartner_id());
		    	param.put("update_by", user.getUser_id());
		    	
		    	if(partnerIncomeInfo.getIncome() != null) {
		    		param.put("income", partnerIncomeInfo.getIncome());
		    	}
		    	if(partnerIncomeInfo.getIncome_base() != null) {
		    		param.put("income_base", partnerIncomeInfo.getIncome_base());
		    	}
		    	if(partnerIncomeInfo.getIncome_extra() != null) {
		    		param.put("income_extra", partnerIncomeInfo.getIncome_extra());
		    	}
		    	if(partnerIncomeInfo.getIncome_bonus() != null) {
		    		param.put("income_bonus", partnerIncomeInfo.getIncome_bonus());
		    	}
		    	if(partnerIncomeInfo.getYear() != null) {
		    		param.put("year", partnerIncomeInfo.getYear());
		    	}
		    	if(partnerIncomeInfo.getMonth() != null) {
		    		param.put("month", partnerIncomeInfo.getMonth());
		    	}
		    	if(partnerIncomeInfo.getDay() != null) {
		    		param.put("day", partnerIncomeInfo.getDay());
		    	}
		    	if(partnerIncomeInfo.getDesc() != null) {
		    		param.put("desc", partnerIncomeInfo.getDesc());
		    	}
		    	
		    	// 添加
	    		itbComService.addPartnerIncome(param);
	    		this.writeJSON("ok");
	    		
	    	} else {
	    		this.writeJSON("ng");
	    	}
		} else {
    		this.writeJSON("ng");
    	}
	}
	
	// 删除合伙人收益项目
	public void delPartnerIncome() throws Exception {
		Map<String, Object> session = ActionContext.getContext().getSession();
    	UserInfoDto user = (UserInfoDto)session.get("user");
    	if(user != null && user.getUser_id()>0) {
    		itbComService.delPartnerIncome(ids);
        	this.writeJSON("ok");
    	} else {
    		this.writeJSON("ng");
    	}
	}
	
	// 计算月收益
	public String calPartnerIncome() throws Exception {
		if(partnerIncomeInfo!=null && partnerIncomeInfo.getPartner_id()>0) {
			Map<String, Object> param = new HashMap<String, Object>();
			param.put("partner_id", partnerIncomeInfo.getPartner_id());
			
			String startDt = ItbComWebAction.getFirstDayOfMonth(partnerIncomeInfo.getYear(),
					partnerIncomeInfo.getMonth()) + " 00:00:00";
			param.put("startDt", startDt);
			
			String endDt = ItbComWebAction.getLastDayOfMonth(partnerIncomeInfo.getYear(),
					partnerIncomeInfo.getMonth()) + " 23:59:59";
			param.put("endDt", endDt);
			
			Long incomeBase = itbComService.calPartnerIncome(param);
			Long incomeEx = itbComService.calPartnerIncomeEx(param);
			partnerIncomeInfo.setIncome_base(incomeBase);
			partnerIncomeInfo.setIncome_extra(incomeEx);
		}
		
		return SUCCESS;
	}
	// 计算月奖金
	public String calPartnerBonus() throws Exception {
		if(partnerIncomeInfo!=null && partnerIncomeInfo.getPartner_id()>0) {
			Map<String, Object> param = new HashMap<String, Object>();
			param.put("partner_id", partnerIncomeInfo.getPartner_id());
			
			String startDt = ItbComWebAction.getFirstDayOfMonth(partnerIncomeInfo.getYear(),
					partnerIncomeInfo.getMonth()) + " 00:00:00";
			param.put("startDt", startDt);
			
			String endDt = ItbComWebAction.getLastDayOfMonth(partnerIncomeInfo.getYear(),
					partnerIncomeInfo.getMonth()) + " 23:59:59";
			param.put("endDt", endDt);
			
			Long bonus = itbComService.calPartnerBonus(param);
			partnerIncomeInfo.setIncome_bonus(bonus);
		}
		
		return SUCCESS;
	}
	
	public static String getFirstDayOfMonth(int year, int month) {     
        Calendar cal = Calendar.getInstance();     
        cal.set(Calendar.YEAR, year);     
        cal.set(Calendar.MONTH, month-1);     
        cal.set(Calendar.DAY_OF_MONTH,cal.getActualMinimum(Calendar.DATE));
        return new SimpleDateFormat("yyyy-MM-dd").format(cal.getTime());  
    }
	
	public static String getLastDayOfMonth(int year, int month) {     
        Calendar cal = Calendar.getInstance();     
        cal.set(Calendar.YEAR, year);     
        cal.set(Calendar.MONTH, month-1);     
        cal.set(Calendar.DAY_OF_MONTH,cal.getActualMaximum(Calendar.DATE));
        return new SimpleDateFormat("yyyy-MM-dd").format(cal.getTime());  
    }
	
	
	// 分页获取合伙人下线用户信息
	public String getPartnerCustInfoPg() throws Exception {
		// 用户信息
		Map<String, Object> session = ActionContext.getContext().getSession();
    	UserInfoDto user = (UserInfoDto)session.get("user");
    	
		HttpServletRequest request = ServletActionContext.getRequest();
		String pageNumber = request.getParameter("page");
		String pageSize = request.getParameter("rows");
		
		Map<String, Object> param = new HashMap<String, Object>();
		if (StringUtils.isNotBlank(findPartnerId)) {
			param.put("partner_id", findPartnerId);
		}
		Page page = itbComService.partnerCustPgQuery(param,
				Integer.parseInt(pageNumber),
				Integer.parseInt(pageSize));
		HashMap<String, Object> resMap = new HashMap<String, Object>();
		resMap.put("total", page.getTotalCount());
		resMap.put("rows", page.getResult());
		//writeJSON(resMap);
		partnerCustMapResult = resMap;
		return SUCCESS;
	}
		
	
	public ItbComService getItbComService() {
		return itbComService;
	}

	public void setItbComService(ItbComService itbComService) {
		this.itbComService = itbComService;
	}

	public HashMap<String, Object> getMapResult() {
		return mapResult;
	}

	public void setMapResult(HashMap<String, Object> mapResult) {
		this.mapResult = mapResult;
	}

	public HashMap<String, Object> getTopicMapResult() {
		return topicMapResult;
	}

	public void setTopicMapResult(HashMap<String, Object> topicMapResult) {
		this.topicMapResult = topicMapResult;
	}

	public TopicInfoDto getTopicInfo() {
		return topicInfo;
	}

	public void setTopicInfo(TopicInfoDto topicInfo) {
		this.topicInfo = topicInfo;
	}

	public String getFindTopicTitle() {
		return findTopicTitle;
	}

	public void setFindTopicTitle(String findTopicTitle) {
		this.findTopicTitle = findTopicTitle;
	}

	public String getFindTopicType() {
		return findTopicType;
	}

	public void setFindTopicType(String findTopicType) {
		this.findTopicType = findTopicType;
	}

	public String getFindTopicUse() {
		return findTopicUse;
	}

	public String getFindPubFlg() {
		return findPubFlg;
	}

	public void setFindPubFlg(String findPubFlg) {
		this.findPubFlg = findPubFlg;
	}

	public void setFindTopicUse(String findTopicUse) {
		this.findTopicUse = findTopicUse;
	}

	public List<TopicInfoDto> getTopicInfoList() {
		return topicInfoList;
	}

	public void setTopicInfoList(List<TopicInfoDto> topicInfoList) {
		this.topicInfoList = topicInfoList;
	}

	public String getIds() {
		return ids;
	}

	public void setIds(String ids) {
		this.ids = ids;
	}

	public String getStId() {
		return stId;
	}

	public void setStId(String stId) {
		this.stId = stId;
	}

	public String getOrder() {
		return order;
	}

	public void setOrder(String order) {
		this.order = order;
	}

	public HashMap<String, Object> getFeedbackMapResult() {
		return feedbackMapResult;
	}

	public void setFeedbackMapResult(HashMap<String, Object> feedbackMapResult) {
		this.feedbackMapResult = feedbackMapResult;
	}

	public List<FeedbackInfoDto> getFeedbackInfoList() {
		return feedbackInfoList;
	}

	public void setFeedbackInfoList(List<FeedbackInfoDto> feedbackInfoList) {
		this.feedbackInfoList = feedbackInfoList;
	}

	public String getFbId() {
		return fbId;
	}

	public void setFbId(String fbId) {
		this.fbId = fbId;
	}

	public List<FeedbackFromInfoDto> getFbFromComboList() {
		return fbFromComboList;
	}

	public void setFbFromComboList(List<FeedbackFromInfoDto> fbFromComboList) {
		this.fbFromComboList = fbFromComboList;
	}

	public String getFindFbFrom() {
		return findFbFrom;
	}

	public void setFindFbFrom(String findFbFrom) {
		this.findFbFrom = findFbFrom;
	}

	public String getFindFbState() {
		return findFbState;
	}

	public void setFindFbState(String findFbState) {
		this.findFbState = findFbState;
	}

	public String getFindFbMobile() {
		return findFbMobile;
	}

	public void setFindFbMobile(String findFbMobile) {
		this.findFbMobile = findFbMobile;
	}

	public FeedbackInfoDto getFeedbackInfo() {
		return feedbackInfo;
	}

	public void setFeedbackInfo(FeedbackInfoDto feedbackInfo) {
		this.feedbackInfo = feedbackInfo;
	}

	public String getFindTopicTypeL() {
		return findTopicTypeL;
	}

	public void setFindTopicTypeL(String findTopicTypeL) {
		this.findTopicTypeL = findTopicTypeL;
	}

	public HashMap<String, Object> getCoopAppMapResult() {
		return coopAppMapResult;
	}

	public void setCoopAppMapResult(HashMap<String, Object> coopAppMapResult) {
		this.coopAppMapResult = coopAppMapResult;
	}

	public List<CoopAppInfoDto> getCoopAppInfoList() {
		return coopAppInfoList;
	}

	public void setCoopAppInfoList(List<CoopAppInfoDto> coopAppInfoList) {
		this.coopAppInfoList = coopAppInfoList;
	}

	public CoopAppInfoDto getCoopAppInfo() {
		return coopAppInfo;
	}

	public void setCoopAppInfo(CoopAppInfoDto coopAppInfo) {
		this.coopAppInfo = coopAppInfo;
	}

	public String getFindAppState() {
		return findAppState;
	}

	public void setFindAppState(String findAppState) {
		this.findAppState = findAppState;
	}

	public String getFindAppMobile() {
		return findAppMobile;
	}

	public void setFindAppMobile(String findAppMobile) {
		this.findAppMobile = findAppMobile;
	}

	public String getFindAppType() {
		return findAppType;
	}

	public void setFindAppType(String findAppType) {
		this.findAppType = findAppType;
	}

	public HashMap<String, Object> getPartnerMapResult() {
		return partnerMapResult;
	}

	public void setPartnerMapResult(HashMap<String, Object> partnerMapResult) {
		this.partnerMapResult = partnerMapResult;
	}

	public List<PartnerInfoDto> getPartnerInfoList() {
		return partnerInfoList;
	}

	public void setPartnerInfoList(List<PartnerInfoDto> partnerInfoList) {
		this.partnerInfoList = partnerInfoList;
	}

	public PartnerInfoDto getPartnerInfo() {
		return partnerInfo;
	}

	public void setPartnerInfo(PartnerInfoDto partnerInfo) {
		this.partnerInfo = partnerInfo;
	}

	public String getFindPartnerName() {
		return findPartnerName;
	}

	public void setFindPartnerName(String findPartnerName) {
		this.findPartnerName = findPartnerName;
	}

	public String getFindPartnerMobile() {
		return findPartnerMobile;
	}

	public void setFindPartnerMobile(String findPartnerMobile) {
		this.findPartnerMobile = findPartnerMobile;
	}

	public String getFindPartnerLevel() {
		return findPartnerLevel;
	}

	public void setFindPartnerLevel(String findPartnerLevel) {
		this.findPartnerLevel = findPartnerLevel;
	}

	public HashMap<String, Object> getPartnerAreaMapResult() {
		return partnerAreaMapResult;
	}

	public void setPartnerAreaMapResult(HashMap<String, Object> partnerAreaMapResult) {
		this.partnerAreaMapResult = partnerAreaMapResult;
	}

	public List<PartnerAreaInfoDto> getPartnerAreaInfoList() {
		return partnerAreaInfoList;
	}

	public void setPartnerAreaInfoList(List<PartnerAreaInfoDto> partnerAreaInfoList) {
		this.partnerAreaInfoList = partnerAreaInfoList;
	}

	public PartnerAreaInfoDto getPartnerAreaInfo() {
		return partnerAreaInfo;
	}

	public void setPartnerAreaInfo(PartnerAreaInfoDto partnerAreaInfo) {
		this.partnerAreaInfo = partnerAreaInfo;
	}

	public String getFindPartnerId() {
		return findPartnerId;
	}

	public void setFindPartnerId(String findPartnerId) {
		this.findPartnerId = findPartnerId;
	}

	public List<ItbAreaInfoDto> getAreaComboList() {
		return areaComboList;
	}

	public void setAreaComboList(List<ItbAreaInfoDto> areaComboList) {
		this.areaComboList = areaComboList;
	}

	public HashMap<String, Object> getPartnerIncomeMapResult() {
		return partnerIncomeMapResult;
	}

	public void setPartnerIncomeMapResult(
			HashMap<String, Object> partnerIncomeMapResult) {
		this.partnerIncomeMapResult = partnerIncomeMapResult;
	}

	public List<PartnerIncomeInfoDto> getPartnerIncomeInfoList() {
		return partnerIncomeInfoList;
	}

	public void setPartnerIncomeInfoList(
			List<PartnerIncomeInfoDto> partnerIncomeInfoList) {
		this.partnerIncomeInfoList = partnerIncomeInfoList;
	}

	public PartnerIncomeInfoDto getPartnerIncomeInfo() {
		return partnerIncomeInfo;
	}

	public void setPartnerIncomeInfo(PartnerIncomeInfoDto partnerIncomeInfo) {
		this.partnerIncomeInfo = partnerIncomeInfo;
	}

	public HashMap<String, Object> getPartnerCustMapResult() {
		return partnerCustMapResult;
	}

	public void setPartnerCustMapResult(HashMap<String, Object> partnerCustMapResult) {
		this.partnerCustMapResult = partnerCustMapResult;
	}

	public List<PartnerCustInfoDto> getPartnerCustInfoList() {
		return partnerCustInfoList;
	}

	public void setPartnerCustInfoList(List<PartnerCustInfoDto> partnerCustInfoList) {
		this.partnerCustInfoList = partnerCustInfoList;
	}

	public PartnerCustInfoDto getPartnerCustInfo() {
		return partnerCustInfo;
	}

	public void setPartnerCustInfo(PartnerCustInfoDto partnerCustInfo) {
		this.partnerCustInfo = partnerCustInfo;
	}

	public String getFindApplyProv() {
		return findApplyProv;
	}

	public void setFindApplyProv(String findApplyProv) {
		this.findApplyProv = findApplyProv;
	}

	public String getFindApplyCity() {
		return findApplyCity;
	}

	public void setFindApplyCity(String findApplyCity) {
		this.findApplyCity = findApplyCity;
	}

	public String getFindApplyDist() {
		return findApplyDist;
	}

	public void setFindApplyDist(String findApplyDist) {
		this.findApplyDist = findApplyDist;
	}

	public String getFindHasCustFlg() {
		return findHasCustFlg;
	}
	public void setFindHasCustFlg(String findHasCustFlg) {
		this.findHasCustFlg = findHasCustFlg;
	}

	public HashMap<String, Object> getResult() {
		return result;
	}
	public void setResult(HashMap<String, Object> result) {
		this.result = result;
	}

	public HashMap<String, Object> getsDesignRes() {
		return sDesignRes;
	}
	public void setsDesignRes(HashMap<String, Object> sDesignRes) {
		this.sDesignRes = sDesignRes;
	}

	public String getFindTmplName() {
		return findTmplName;
	}

	public void setFindTmplName(String findTmplName) {
		this.findTmplName = findTmplName;
	}

	public String getFindTmplId() {
		return findTmplId;
	}

	public void setFindTmplId(String findTmplId) {
		this.findTmplId = findTmplId;
	}

	public String getFindItemId() {
		return findItemId;
	}
	public void setFindItemId(String findItemId) {
		this.findItemId = findItemId;
	}
	public String getFindVip() {
		return findVip;
	}
	public void setFindVip(String findVip) {
		this.findVip = findVip;
	}
	public List<TypeInfoDto> getListType() {
		return listType;
	}
	public void setListType(List<TypeInfoDto> listType) {
		this.listType = listType;
	}

	public String getFindTmplType() {
		return findTmplType;
	}
	public void setFindTmplType(String findTmplType) {
		this.findTmplType = findTmplType;
	}
}
